From 63c9342e30f24f4a270a67315c3d75d794855728 Mon Sep 17 00:00:00 2001 From: William Jon McCann Date: Mon, 16 Dec 2013 11:06:24 -0500 Subject: [PATCH] about dialog: differentiate GPL "or later" versions https://bugzilla.gnome.org/show_bug.cgi?id=720410 --- gtk/gtkaboutdialog.c | 46 ++++++++++++++++++++++++++------------------ gtk/gtkaboutdialog.h | 7 ++++++- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c index 1e5536df71..a694a191ec 100644 --- a/gtk/gtkaboutdialog.c +++ b/gtk/gtkaboutdialog.c @@ -94,25 +94,31 @@ */ /* Translators: this is the license preamble; the string at the end - * contains the URL of the license. + * contains the name of the license as link text. */ -static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY;\nfor details, visit %s"); +static const gchar *gtk_license_preamble = N_("This program comes with ABSOLUTELY NO WARRANTY.\nSee the %s for details."); -/* URLs for each GtkLicense type; keep in the same order as the enumeration */ -static const gchar *gtk_license_urls[] = { - NULL, - NULL, - - "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", - "http://www.gnu.org/licenses/gpl.html", - - "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html", - "http://www.gnu.org/licenses/lgpl.html", - - "http://opensource.org/licenses/bsd-license.php", - "http://opensource.org/licenses/mit-license.php", - - "http://opensource.org/licenses/artistic-license-2.0.php" +typedef struct +{ + const gchar *name; + const gchar *url; +} LicenseInfo; + +/* LicenseInfo for each GtkLicense type; keep in the same order as the enumeration */ +static const LicenseInfo gtk_license_info [] = { + { N_("License"), NULL }, + { N_("Custom License") , NULL }, + { N_("GNU General Public License, version 2 or later"), "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" }, + { N_("GNU General Public License, version 3 or later"), "http://www.gnu.org/licenses/gpl.html" }, + { N_("GNU Lesser General Public License, version 2.1 or later"), "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" }, + { N_("GNU Lesser General Public License, version 3 or later"), "http://www.gnu.org/licenses/lgpl.html" }, + { N_("BSD 2-Clause License"), "http://opensource.org/licenses/bsd-license.php" }, + { N_("The MIT License (MIT)"), "http://opensource.org/licenses/mit-license.php" }, + { N_("Artistic License 2.0"), "http://opensource.org/licenses/artistic-license-2.0.php" }, + { N_("GNU General Public License, version 2 only"), "http://www.gnu.org/licenses/old-licenses/gpl-2.0.html" }, + { N_("GNU General Public License, version 3 only"), "http://www.gnu.org/licenses/gpl.html" }, + { N_("GNU Lesser General Public License, version 2.1 only"), "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" }, + { N_("GNU Lesser General Public License, version 3 only"), "http://www.gnu.org/licenses/lgpl.html" } }; typedef struct @@ -2479,16 +2485,18 @@ gtk_about_dialog_set_license_type (GtkAboutDialog *about, /* custom licenses use the contents of the :license property */ if (priv->license_type != GTK_LICENSE_CUSTOM) { + const gchar *name; const gchar *url; gchar *license_string; GString *str; - url = gtk_license_urls[priv->license_type]; + name = _(gtk_license_info[priv->license_type].name); + url = gtk_license_info[priv->license_type].url; if (url == NULL) url = priv->website_url; str = g_string_sized_new (256); - g_string_append_printf (str, _(gtk_license_preamble), url, url); + g_string_append_printf (str, _(gtk_license_preamble), url, name); g_free (priv->license); priv->license = g_string_free (str, FALSE); diff --git a/gtk/gtkaboutdialog.h b/gtk/gtkaboutdialog.h index 61cf6b68d3..302e763e0b 100644 --- a/gtk/gtkaboutdialog.h +++ b/gtk/gtkaboutdialog.h @@ -74,7 +74,12 @@ typedef enum { GTK_LICENSE_BSD, GTK_LICENSE_MIT_X11, - GTK_LICENSE_ARTISTIC + GTK_LICENSE_ARTISTIC, + + GTK_LICENSE_GPL_2_0_ONLY, + GTK_LICENSE_GPL_3_0_ONLY, + GTK_LICENSE_LGPL_2_1_ONLY, + GTK_LICENSE_LGPL_3_0_ONLY } GtkLicense; /** -- 2.30.2